#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;
const int L = 1e6 + 5;
int T;
// 车辆数量、测速仪数量、主干道长度 道路限速
int n, m, L, V;
struct cars
{
    int d, v, nv, a;
    vector<int> p;
} arr[N];
bool p[L];

int main()
{
    freopen("detect.in", "r", stdin);
    freopen("detect.out", "w", stdout);

    cin >> T;

    while (T--)
    {
        memset(p, false, sizeof(p));
        cin >> n >> m >> L >> V;
        for (int i = 1; i <= n; i++)
        {
            cin >> car[i].d >> car[i].v >> car[i].a;
            car[i].nv = car[i].v;
        }
        for (int i = 1; i <= m; i++)
        {
            int a;
            cin >> a;
            p[a] = true;
        }
        for (int i = 1; i <= n; i++)
        {
            while (car[i].d != L)
            {
                if (p[car[i].d] && car[i].nv > V)
                {
                    car[i].p.push_back(car[i].d);
                }
                car[i].nv =
            }
        }
    }

    return 0;
}
